﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;

namespace GataBaseSys
{
    public partial class WebForm4 : System.Web.UI.Page
    {
        AuctionBLL abbll = new AuctionBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Repeater1.DataSource = abbll.auctions();
            this.Repeater1.DataBind();
        }

        protected void LinkButton1_Command(object sender, CommandEventArgs e)
        {
            int id =Convert.ToInt32(e.CommandArgument);
                Auction au = new Auction();
                au.AuctionID=Convert.ToInt32(e.CommandArgument);
                if (abbll.DeleteAue(au))
                {
                this.Repeater1.DataSource = abbll.auctions();
                this.Repeater1.DataBind();
            }
        }

        protected void LinkButton2_Command(object sender, CommandEventArgs e)
        {
            int id = Convert.ToInt32(e.CommandArgument);
            Session["id"] = id;
            Server.Transfer ("Xiugai.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Auction acu = new Auction();
            acu.AuctionName = this.TextBox1.Text.Trim();
            acu.AuctionState= this.TextBox1.Text.Trim();
            this.Repeater1.DataSource = abbll.Gid(acu);
            this.Repeater1.DataBind();
        }
        public static string Showddd(int code)
        {
            string named = "";
            if (code == 1)
            {
                named = "北京";
            }
            if (code == 2)
            {
                named = "上海";
            }
            if (code == 3)
            {
                named = "重庆";
            }
            if (code == 4)
            {
                named = "广州";
            }
            if (code == 5)
            {
                named = "深圳";
            }
            if (code == 6)
            {
                named = "贵州";
            }
            return named;
        }
    }
}